package com.balance.anole.business.to;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.balance.anole.admin.to.AgentTO;
import com.balance.anole.admin.to.SupplierTO;
import com.balance.anole.common.to.AnoleBaseTO;
import com.balance.anole.common.to.CodeLookTO;
import com.balance.anole.utils.NumberUtil;

public class ProductTO extends AnoleBaseTO {

	/**
	 *
	 */
	private static final long serialVersionUID = -5696816042503466203L;

	private String sn;
	private String pdtDesc;
	private ProductGroupTO pdtGroupTO;
	private ProductBrandTO brand;
	private CodeLookTO sex;
	private String styleId;
	private CodeLookTO style;
	private CodeLookTO unit;
	private CodeLookTO minUnit;
	private String pdtGenYear;
	private String batchNo;
	private CodeLookTO status;
	private CodeLookTO season;
	private String assistCode;
	private String serialNo;
	private Date startDate;
	private Date endDate;
	private CodeLookTO saleLevel;
	private CodeLookTO saleType;
	private CodeLookTO marketLevel;
	private CodeLookTO channel;
	private CodeLookTO recommendationLevel;
	private BigDecimal taxRate;
	private CodeLookTO fabric;
	private CodeLookTO lining;
	private String manufacturingProcessesDesc;
	private CodeLookTO manufacturingProcessesType;
	private CodeLookTO productLevel;
	private AgentTO designerAgent;
	private String designer;
	private String sampleIndicator;
	private String sampleId;
	private String formId;
	private String multiColorIndicator;
	private String multiSizeIndicator;
	private CodeLookTO sizeType;
	private CodeLookTO sizeMappingName;
	private CodeLookTO sizeScope;
	private BigDecimal unitWeight;
	private BigDecimal unitVolume;
	private BigDecimal unitLength;
	private BigDecimal unitWidth;
	private BigDecimal unitHeight;
	private BigDecimal packageNumber;
	private BigDecimal packageWeight;
	private BigDecimal packageVolume;
	private BigDecimal packageLength;
	private BigDecimal packageWidth;
	private BigDecimal packageHeight;
	private CodeLookTO abcClassification;
	private String helpDeliverInd;
	private CodeLookTO packageType;
	private BigDecimal qcPercentage;
	private List<ProductItemTO> itemList;
	private SupplierTO supplierTO;
	private BigDecimal discRate;
	private List<ProductPictureTO> picList;
	private List<ProductPriceTO> priceList;

	public String getSn() {
		return sn;
	}
	public void setSn(String sn) {
		this.sn = sn;
	}
	public String getPdtDesc() {
		return pdtDesc;
	}
	public void setPdtDesc(String pdtDesc) {
		this.pdtDesc = pdtDesc;
	}
	public ProductGroupTO getPdtGroupTO() {
		return pdtGroupTO;
	}
	public void setPdtGroupTO(ProductGroupTO pdtGroupTO) {
		this.pdtGroupTO = pdtGroupTO;
	}
	public ProductBrandTO getBrand() {
		return brand;
	}
	public void setBrand(ProductBrandTO brand) {
		this.brand = brand;
	}
	public CodeLookTO getSex() {
		return sex;
	}
	public void setSex(CodeLookTO sex) {
		this.sex = sex;
	}
	public String getStyleId() {
		return styleId;
	}
	public void setStyleId(String styleId) {
		this.styleId = styleId;
	}
	public CodeLookTO getStyle() {
		return style;
	}
	public void setStyle(CodeLookTO style) {
		this.style = style;
	}
	public CodeLookTO getUnit() {
		return unit;
	}
	public void setUnit(CodeLookTO unit) {
		this.unit = unit;
	}
	public CodeLookTO getMinUnit() {
		return minUnit;
	}
	public void setMinUnit(CodeLookTO minUnit) {
		this.minUnit = minUnit;
	}
	public String getPdtGenYear() {
		return pdtGenYear;
	}
	public void setPdtGenYear(String pdtGenYear) {
		this.pdtGenYear = pdtGenYear;
	}
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}
	public CodeLookTO getStatus() {
		return status;
	}
	public void setStatus(CodeLookTO status) {
		this.status = status;
	}
	public CodeLookTO getSeason() {
		return season;
	}
	public void setSeason(CodeLookTO season) {
		this.season = season;
	}
	public String getAssistCode() {
		return assistCode;
	}
	public void setAssistCode(String assistCode) {
		this.assistCode = assistCode;
	}
	public String getSerialNo() {
		return serialNo;
	}
	public void setSerialNo(String serialNo) {
		this.serialNo = serialNo;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public CodeLookTO getSaleLevel() {
		return saleLevel;
	}
	public void setSaleLevel(CodeLookTO saleLevel) {
		this.saleLevel = saleLevel;
	}
	public CodeLookTO getSaleType() {
		return saleType;
	}
	public void setSaleType(CodeLookTO saleType) {
		this.saleType = saleType;
	}
	public CodeLookTO getMarketLevel() {
		return marketLevel;
	}
	public void setMarketLevel(CodeLookTO marketLevel) {
		this.marketLevel = marketLevel;
	}
	public CodeLookTO getChannel() {
		return channel;
	}
	public void setChannel(CodeLookTO channel) {
		this.channel = channel;
	}
	public CodeLookTO getRecommendationLevel() {
		return recommendationLevel;
	}
	public void setRecommendationLevel(CodeLookTO recommendationLevel) {
		this.recommendationLevel = recommendationLevel;
	}
	public BigDecimal getTaxRate() {
		return taxRate;
	}
	public String getTaxRateStr() {
		return NumberUtil.formatBigDecimal(taxRate, "#0.00");
	}
	public void setTaxRate(BigDecimal taxRate) {
		this.taxRate = taxRate;
	}
	public CodeLookTO getFabric() {
		return fabric;
	}
	public void setFabric(CodeLookTO fabric) {
		this.fabric = fabric;
	}
	public CodeLookTO getLining() {
		return lining;
	}
	public void setLining(CodeLookTO lining) {
		this.lining = lining;
	}
	public String getManufacturingProcessesDesc() {
		return manufacturingProcessesDesc;
	}
	public void setManufacturingProcessesDesc(String manufacturingProcessesDesc) {
		this.manufacturingProcessesDesc = manufacturingProcessesDesc;
	}
	public CodeLookTO getManufacturingProcessesType() {
		return manufacturingProcessesType;
	}
	public void setManufacturingProcessesType(CodeLookTO manufacturingProcessesType) {
		this.manufacturingProcessesType = manufacturingProcessesType;
	}
	public CodeLookTO getProductLevel() {
		return productLevel;
	}
	public void setProductLevel(CodeLookTO productLevel) {
		this.productLevel = productLevel;
	}
	public AgentTO getDesignerAgent() {
		return designerAgent;
	}
	public void setDesignerAgent(AgentTO designerAgent) {
		this.designerAgent = designerAgent;
	}
	public String getDesigner() {
		return designer;
	}
	public void setDesigner(String designer) {
		this.designer = designer;
	}
	public String getSampleIndicator() {
		return sampleIndicator;
	}
	public void setSampleIndicator(String sampleIndicator) {
		this.sampleIndicator = sampleIndicator;
	}
	public String getSampleId() {
		return sampleId;
	}
	public void setSampleId(String sampleId) {
		this.sampleId = sampleId;
	}
	public String getFormId() {
		return formId;
	}
	public void setFormId(String formId) {
		this.formId = formId;
	}
	public String getMultiColorIndicator() {
		return multiColorIndicator;
	}
	public void setMultiColorIndicator(String multiColorIndicator) {
		this.multiColorIndicator = multiColorIndicator;
	}
	public String getMultiSizeIndicator() {
		return multiSizeIndicator;
	}
	public void setMultiSizeIndicator(String multiSizeIndicator) {
		this.multiSizeIndicator = multiSizeIndicator;
	}
	public CodeLookTO getSizeType() {
		return sizeType;
	}
	public void setSizeType(CodeLookTO sizeType) {
		this.sizeType = sizeType;
	}
	public CodeLookTO getSizeMappingName() {
		return sizeMappingName;
	}
	public void setSizeMappingName(CodeLookTO sizeMappingName) {
		this.sizeMappingName = sizeMappingName;
	}
	public CodeLookTO getSizeScope() {
		return sizeScope;
	}
	public void setSizeScope(CodeLookTO sizeScope) {
		this.sizeScope = sizeScope;
	}
	public List<ProductItemTO> getItemList() {
		return itemList;
	}
	public void setItemList(List<ProductItemTO> itemList) {
		this.itemList = itemList;
	}
	public BigDecimal getUnitWeight() {
		return unitWeight;
	}
	public void setUnitWeight(BigDecimal unitWeight) {
		this.unitWeight = unitWeight;
	}
	public BigDecimal getUnitVolume() {
		return unitVolume;
	}
	public void setUnitVolume(BigDecimal unitVolume) {
		this.unitVolume = unitVolume;
	}
	public BigDecimal getUnitLength() {
		return unitLength;
	}
	public void setUnitLength(BigDecimal unitLength) {
		this.unitLength = unitLength;
	}
	public BigDecimal getUnitWidth() {
		return unitWidth;
	}
	public void setUnitWidth(BigDecimal unitWidth) {
		this.unitWidth = unitWidth;
	}
	public BigDecimal getUnitHeight() {
		return unitHeight;
	}
	public void setUnitHeight(BigDecimal unitHeight) {
		this.unitHeight = unitHeight;
	}
	public BigDecimal getPackageNumber() {
		return packageNumber;
	}
	public void setPackageNumber(BigDecimal packageNumber) {
		this.packageNumber = packageNumber;
	}
	public BigDecimal getPackageWeight() {
		return packageWeight;
	}
	public void setPackageWeight(BigDecimal packageWeight) {
		this.packageWeight = packageWeight;
	}
	public BigDecimal getPackageVolume() {
		return packageVolume;
	}
	public void setPackageVolume(BigDecimal packageVolume) {
		this.packageVolume = packageVolume;
	}
	public BigDecimal getPackageLength() {
		return packageLength;
	}
	public void setPackageLength(BigDecimal packageLength) {
		this.packageLength = packageLength;
	}
	public BigDecimal getPackageWidth() {
		return packageWidth;
	}
	public void setPackageWidth(BigDecimal packageWidth) {
		this.packageWidth = packageWidth;
	}
	public BigDecimal getPackageHeight() {
		return packageHeight;
	}
	public void setPackageHeight(BigDecimal packageHeight) {
		this.packageHeight = packageHeight;
	}
	public CodeLookTO getAbcClassification() {
		return abcClassification;
	}
	public void setAbcClassification(CodeLookTO abcClassification) {
		this.abcClassification = abcClassification;
	}
	public String getHelpDeliverInd() {
		return helpDeliverInd;
	}
	public void setHelpDeliverInd(String helpDeliverInd) {
		this.helpDeliverInd = helpDeliverInd;
	}
	public CodeLookTO getPackageType() {
		return packageType;
	}
	public void setPackageType(CodeLookTO packageType) {
		this.packageType = packageType;
	}
	public BigDecimal getQcPercentage() {
		return qcPercentage;
	}
	public void setQcPercentage(BigDecimal qcPercentage) {
		this.qcPercentage = qcPercentage;
	}
	public SupplierTO getSupplierTO() {
		return supplierTO;
	}
	public void setSupplierTO(SupplierTO supplierTO) {
		this.supplierTO = supplierTO;
	}
	public BigDecimal getDiscRate() {
		return discRate;
	}
	public void setDiscRate(BigDecimal discRate) {
		this.discRate = discRate;
	}
	public List<ProductPictureTO> getPicList() {
		return picList;
	}
	public void setPicList(List<ProductPictureTO> picList) {
		this.picList = picList;
	}
	public List<ProductPriceTO> getPriceList() {
		return priceList;
	}
	public void setPriceList(List<ProductPriceTO> priceList) {
		this.priceList = priceList;
	}

	public ProductPriceTO getPriceByType(CodeLookTO priceType){
		if(priceList != null && priceList.size() > 0){
			for(ProductPriceTO price : this.priceList){
				if(price != null && price.getPriceType().getCodeTypeId().equalsIgnoreCase(priceType.getCodeTypeId()) && price.getPriceType().getCodeId().equals(priceType.getCodeId())){
					return price;
				}
			}
		}
		return null;
	}
}
